﻿using System;

namespace HW0310_1
{
    class Program
    {
        static void Main()
        {
            Console.Write("Enter a positive integer: ");
            int n = Int32.Parse(Console.ReadLine());
            int i = 2;
            Console.WriteLine("All the prime factors of " + n + " are as follow: ");
            for (i=2; i<n; i++)
            {
                while (n>i)
                {
                    if (n % i == 0)
                    {
                        Console.Write(i + " ");
                        n /= i;
                    }
                    else if (n % i != 0 || n == i)
                        break;
                }
            }
            Console.Write(i + "\n");
        }
    }
}